package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsGridDitConfig;
import com.econ.powercloud.ems.dal.mapper.EmsGridDitConfigMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author jwc
 * @since 2022-08-22
 */
@Repository
public class EmsGridDitConfigDAO extends ServiceImpl<EmsGridDitConfigMapper, EmsGridDitConfig> {

    public List<EmsGridDitConfig> selectByStationId(String stationId){
        LambdaQueryWrapper<EmsGridDitConfig> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(EmsGridDitConfig::getEnergyStationId,stationId);
        wrapper.orderByAsc(EmsGridDitConfig::getSortNum);
        return this.baseMapper.selectList(wrapper);
    }
}
